// pages/theme/theme.js
import {Theme} from '../../models/theme.js'
var theme = new Theme()
Page({

  data: {
    themeDetail: ""
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this._loadData(options.id)
    
  },

  _loadData(id){
    theme.getThemeDatail(id, (res) => {
      theme.showLoading()
      res.data.book = theme.compBuyPriceFromArray(res.data.book)
      this.setData({
        themeDetail: res.data
      })
      wx.hideLoading()
    })
  }
})